import { pget, ppostJson, ppost } from '@/utils/req'
import { modalApi } from '@/utils/modalReq'

// 线索列表
export function getClueList(query: any) {
	return pget(`${modalApi.sales}/sale/clue/page`, query)
}

// 线索详情
export function getClueDetail(query: any) {
	return pget(`${modalApi.sales}/sale/clue/detail`, query)
}

// 线索编辑
export function clueUpdate(query: any) {
	return ppostJson(`${modalApi.sales}/sale/clue/update`, query)
}

// 线索保存
export function saveClue(query: any) {
	return ppostJson(`${modalApi.sales}/sale/clue/save`, query)
}

// 线索删除
export function clueRemove(query: any) {
	return ppost(`${modalApi.sales}/sale/clue/remove?ids=${query}`,)
}

// 详情页跟进记录分页
export function getRecordList(query: any) {
	return pget(`${modalApi.sales}/sale/clue/record/page`, query)
}

// 详情页跟进记录分页
export function getRecommendList(query: any) {
	return pget(`${modalApi.sales}/sale/clue/recommend/page`, query)
}

// 查询所有主体
export function getSubjectCompany() {
	return pget(`${modalApi.sales}/sale/clue/getSubjectCompany`)
}

// 根据type查询字典
export function getKeyValueByType(query: any) {
	return pget(`${modalApi.sales}/sale/clue/getKeyValueByType`, query)
}

// 校验司机手机号返回司机信息 Copy
export function checkNewDriverPhone(query: any) {
	return pget(`${modalApi.sales}/sale/ditch/checkDriverPhone`, query)
}

// 校验司机手机号返回司机信息 Copy
export function checkDriverPhone(query: any) {
	return pget(`${modalApi.sales}/sale/ditch/getChannelByPhone`, query)
}

// 渠道拉新规则奖励导入
export async function getExcl(params: any): Promise<any> {
	return pget(`${modalApi.sales}/sale/channelinnovationrewards/importData?batch=${params?.batch}`);
}
// 渠道拉新规则奖励文件
export const postExcl = `${modalApi.sales}/sale/channelinnovationrewards/import/check`

// 获取渠道导入数据列表
export async function getData(params: any): Promise<any> {
	return pget(`${modalApi.sales}/sale/channelinnovationrewards/errorListPage`, params);
}

// 线索导入
export async function getExclclue(params: any): Promise<any> {
	return pget(`${modalApi.sales}/sale/clue/importData?batch=${params?.batch}`);
}
// 线索文件
export const postExcclue = `${modalApi.sales}/sale/clue/import/check`


// 获取线索数据列表
export async function getDataclue(params: any): Promise<any> {
	return pget(`${modalApi.sales}/sale/clue/errorListPage`, params);
}

// 渠道导入
export async function getExclChannel(params: any): Promise<any> {
	return pget(`${modalApi.sales}/sale/ditch/importData?batch=${params?.batch}`);
}
// 渠道文件
export const postExcChannel = `${modalApi.sales}/sale/ditch/import/check`


// 获取渠道列表
export async function getDataSettlement(params: any): Promise<any> {
	return pget(`${modalApi.sales}/sale/ditch/errorListPage`, params);
}

// 渠道结算导入
export async function getExclSettlement(params: any): Promise<any> {
	return pget(`${modalApi.sales}/ditchreplenish/ditchreplenishImport${params?.batch}`);
}
// 渠道结算文件
export const postExcSettlement = `${modalApi.common}/shopec-systembase/baseattachment/uploadFiles`


// 获取渠道结算列表
export async function getDataChannels(params: any): Promise<any> {
	return pget(`${modalApi.sales}/ditchreplenish/errorRulesPage`, params);
}

// 获取线索统计
export async function getClueCount(): Promise<any> {
	return pget(`${modalApi.sales}/sale/clue/count
`);
}
// 获取渠道自营BD数据
export async function getAllBdDitch(params: any): Promise<any> {
	return pget(`${modalApi.sales}/sale/ditch/getAllBdDitch`, params);
}
